package broadcastreceiver;

import android.annotation.SuppressLint;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.support.annotation.RequiresApi;

import ui.SplashActivity;

/**
 * Created by Administrator on 2017/4/29.
 * Edited by Monkey_C
 */
@SuppressLint("UnsafeProtectedBroadcastReceiver")
@RequiresApi(api = Build.VERSION_CODES.CUPCAKE)
public class AutoStartBroadcastReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {

        Intent mIntent = new Intent(context, SplashActivity.class);
        mIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
        context.startActivity(mIntent);

    }
}
